<script>
// app.js
export default {
    data() {
        return {};
    },
    onLaunch() {
        let that = this;
        // 展示本地存储能力
        const logs = uni.getStorageSync('logs') || [];
        logs.unshift(Date.now());
        uni.setStorageSync('logs', logs);

        // 登录
        uni.login({
            success: (res) => {
                // console.log(res)
                // 发送 res.code 到后台换取 openId, sessionKey, unionId
                uni.request({
                    url: that.globalData.url + '/wxpai/login/wxLogin',
                    //请求的接口地址
                    data: {
                        code: res.code
                    },
                    header: {
                        'content-type': 'application/x-www-form-urlencoded'
                    },
                    success(res) {
                        // console.log(res.data)
                        if (res.data.code == 200) {
                            if (res.data.data.openid) {
                                // console.log(res.data)
                                that.globalData.openid = res.data.data.openid;
                                that.globalData.session_key = res.data.data.session_key;
                                uni.setStorageSync('openid', res.data.data.openid);
                                // console.log(that.globalData)
                            }
                        }
                    }
                });
            }
        });
    },
    //是全局的数据存储
    globalData: {
        userInfo: null,
        // url:'http://127.0.0.1:8099', //真实上线是一个域名
        url: 'http://localhost:8099',
        //真实上线是一个域名
        openid: '',
        session_key: '',
        token: ''
    }
};
</script>
<style>

/**app.wxss**/
page {
    height: 100%;
}
.container {
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    padding: 200rpx 0;
    box-sizing: border-box;
}

/* 防止图片闪一下 */

/* #ifndef APP-PLUS-NVUE */
image{will-change: transform}
/* #endif */

/* scroll-view */

/* #ifndef APP-PLUS-NVUE */
.scroll-row{ width: 100%;white-space: nowrap; }
/* #endif */

.scroll-row-item{ display: inline-block; }
/* #ifndef APP-PLUS-NVUE */
::-webkit-scrollbar {
  width: 0;
  height: 0;
  color: transparent;
}
/* #endif */
/* 颜色变量 */
/* #ifndef APP-PLUS-NVUE */
page{
	--primary:#E61717;
	--secondary: #6c757d;
	--success: #28a745;
	--danger: #dc3545;
	--warning: #ffc107;
	--info: #17a2b8;
	--light: #f8f9fa;
	--dark: #000000;
	--muted: #6c757d;
	--white: #fff;
	--borderColor:#dee2e6;
	--lightmuted:#B2B2B2;
	/* 
		iphone 手机底部home键高度，需要在页面的最外层盒子加上,以在iphone手机正常显示
		padding-bottom: var(--iphonex-fix-bottom);
	*/
	--iphonex-fix-bottom: env(safe-area-inset-bottom) 
}
/* #endif */

/* #ifndef APP-PLUS-NVUE */
.iphonx-fix-bottom {
	padding-bottom: var(--iphonex-fix-bottom);
}
/* #endif */

/* 阴影 */
.shadow-sm {
    box-shadow: 0 2rpx 4rpx rgba(114, 130, 138, 0.2)!important;
}
.shadow {
    box-shadow: 0 8rpx 16rpx rgba(114, 130, 138, 0.2)!important;
}
.shadow-lg {
    box-shadow: 0 16rpx 48rpx rgba(114, 130, 138, 0.2)!important;
}
/* 定位 */
.position-absolute{ position: absolute; }
.position-fixed{ position: fixed; }
.position-relative{ position: relative; }
.relative-z-max { position:relative;z-index:9999 }
.z-max { z-index: 999 }
.left-0{ left: 0; }
.top-0{ top: 0; }
.bottom-0{ bottom: 0; }
.right-0{ right: 0; }
/* 宽高 */
.w-100{ width: 100%;}
.w-param-100 { width: 750rpx; }
.w-50{ width: 50%;}
.h-100{ height: 100%;}
.h-50{ width: 50%; }
/* 字体 */
.font{ font-size: 25rpx; }
.font-ssm {font-size: 20rpx;}
.font-sm{ font-size: 22rpx; }
.font-smd{  font-size: 28rpx; }
.font-md{ font-size: 30rpx; }
.font-mmd { font-size: 35rpx; }
.font-lg{ font-size: 40rpx; }
.font-big{ font-size: 60rpx; }
.font-weight{ font-weight: bold!important; }
.font-weight-100{ font-weight: 100!important; }
.font-weight-400{ font-weight: 400!important; }
.font-weight-500{ font-weight: 500!important; }
.font-weight-600 {font-weight: 600!important;}
.font-weight-700 {font-weight: 700!important;}
/* 行高 */
.line-h0{ line-height: 0!important; }
.line-h{ line-height: 1!important; }
.line-h-sm{ line-height: 1.2!important; }
.line-h-md{ line-height: 1.5!important; }
.line-h-lg{ line-height: 2!important; }
.line-h-big{ line-height: 3!important; }

.line-through{ text-decoration: line-through; }
.text-center{ text-align: center; }
.text-left{ text-align: left; }
.text-right{ text-align: right; }

/* 布局 */

/* #ifndef APP-PLUS-NVUE */
.row { box-sizing: border-box!important; display: flex!important; flex-direction: row; flex-wrap: wrap;}
/* #endif */

/* #ifndef APP-PLUS-NVUE */
[class*='col-'],[class*='span-'],[class*='span24-'] { min-height: 1px;box-sizing: border-box!important;}
/* #endif */

/* 栅栏一（12份） */
.col-1{ width: 62.5rpx; } 
.col-2{ width: 125rpx; } 
.col-3{ width: 187.5rpx; } 
.col-4{ width: 250rpx;} 
.col-5{ width: 312.5rpx; } 
.col-6{ width: 375rpx; }
.col-7{ width: 437.5rpx; }
.col-8{ width: 500rpx; }
.col-9{ width: 562.5rpx; }
.col-10{ width: 625rpx; }
.col-11{ width: 687.5rpx; }
.col-12{ width: 750rpx; }
/* 栅栏二 */
.span-1{ width: 5%; } 
.span-2{ width: 10%; } 
.span-3{ width: 15%; } 
.span-4{ width: 20%;} 
.span-5{ width: 25%; } 
.span-6{ width: 30%; }
.span-7{ width: 35%; }
.span-8{ width: 40%; }
.span-9{ width: 45%; }
.span-10{ width: 50%; }
.span-11{ width: 55%; }
.span-12{ width: 60%; }
.span-13{ width: 65%; }
.span-14{ width: 70%; }
.span-15{ width: 75%; }
.span-16{ width: 80%; }
.span-17{ width: 85%; }
.span-18{ width: 90%; }
.span-19{ width: 95%; }
.span-20{ width: 100%; }
/* 栅栏三 */
.span24-1{ width: 4.17%; } 
.span24-2{ width: 8.33%; } 
.span24-3{ width: 12.5%; } 
.span24-4{ width: 16.67%;} 
.span24-5{ width: 20.83%; } 
.span24-6{ width: 25%; }
.span24-7{ width: 29.17%; }
.span24-8{ width: 33.33%; }
.span24-9{ width: 37.5%; }
.span24-10{ width: 41.67%; }
.span24-11{ width: 45.83%; }
.span24-12{ width: 50%; }
.span24-13{ width: 54.17%; }
.span24-14{ width: 58.33%; }
.span24-15{ width: 62.5%; }
.span24-16{ width: 66.67%; }
.span24-17{ width: 70.83%; }
.span24-18{ width: 75%; }
.span24-19{ width: 79.17%; }
.span24-20{ width: 83.33%; }
.span24-21{ width: 87.5%; }
.span24-22{ width: 91.67%; }
.span24-23{ width: 95.83%; }
.span24-24{ width: 100%; }


/* display */
.d-flex{ display: flex; }
/* #ifndef APP-PLUS-NVUE */
.d-block{ display: block; }
/* #endif */
.d-none { display: none!important; }

/* #ifndef APP-PLUS-NVUE */
.d-inline-block{ display: inline-block; }
/* #endif */
/* flex */
.flex-1{ flex: 1; }
.flex-column{ flex-direction: column; }
.flex-row{ flex-direction: row; }
.flex-wrap{ flex-wrap: wrap; }
.flex-nowrap{ flex-wrap: nowrap; }
/* #ifndef APP-PLUS-NVUE */
.flex-shfrink{flex-shrink: 0;}
/* #endif */
.j-start{ justify-content: flex-start; }
.j-center{ justify-content: center; }
.j-end{ justify-content: flex-end; }
.j-sb{ justify-content: space-between; }
.j-around{ justify-content: space-around;}
.a-center{ align-items:center; }
/* #ifndef APP-PLUS-NVUE */
.a-baseline { align-items: baseline; }
/* #endif */
.a-start{ align-items: flex-start; }
.a-end{ align-items:flex-end; }
.a-stretch{ align-items: stretch; }

/* #ifndef APP-PLUS-NVUE */
.a-self-start{ align-self: flex-start; }
.a-self-auto{ align-self: auto; }
.a-self-end{ align-self: flex-end; }
.a-self-stretch{ align-self:stretch; }
.a-self-baseline{ align-self:baseline; }
/* #endif */

.r-reverse{flex-direction: row-reverse;}
/* Border */
.border{  border-width: 1rpx; border-style: solid; border-color: var(--borderColor);}
.border-top{ border-top-width: 1rpx; border-top-style: solid; border-top-color: var(--borderColor); }
.border-right{ border-right-width: 1rpx; border-right-style: solid; border-right-color: var(--borderColor);}
.border-bottom{ border-bottom-width: 1px;border-bottom-style: solid;border-bottom-color:#dddddd}
.border-left{ border-left-width: 1rpx;border-left-style: solid;border-left-color:var(--borderColor);}



.border-0{ border-width: 0; }
.border-top-0{ border-top-width: 0; }
.border-right-0{ border-right-width: 0; }
.border-bottom-0{ border-bottom-width: 0; }
.border-left-0{ border-left-width: 0; }

.border-primary{ border-color: var(--primary)!important }
.border-secondary{ border-color:var(--secondary)!important }
.border-success{ border-color: var(--success)!important }
.border-danger{ border-color: var(--danger)!important }
.border-warning{ border-color:var(--warning)!important }
.border-info{ border-color: var(--info)!important }
.border-light{ border-color: var(--light)!important }
.border-dark{ border-color: var(--dark)!important }
.border-white{ border-color: var(--white)!important }
.border-light-secondary{border-color: #F1F1F1!important;}

.rounded-sm{ border-radius: 5rpx; }
.rounded-md{ border-radius: 10rpx; }
.rounded-circle{ border-radius:100%; }
.rounded-50 { border-radius: 50%; }
.rounded-0{ border-radius:0; }

/* color */
.text-gray { color: #989898!important; }
.text-primary{ color:var(--primary)!important; }
.text-secondary{ color:var(--secondary)!important; }
.text-success{ color:var(--success)!important; }
.text-danger{ color: var(--danger)!important; }
.text-warning{ color:var(--warning)!important; }
.text-info{ color: var(--info)!important; }
.text-light{ color: var(--light)!important; }
.text-dark{ color: #000000 !important; }
.text-muted{ color: var(--muted)!important; }
.text-light-muted{ color: var(--lightmuted)!important; }
.text-white{ color: #ffffff!important; }
.text-light-dark { color: #333333 !important; }
.text-light-dark-more { color: #666666 !important; }
.text-light-dark-most { color: #999999 !important; }
.bg-primary{ background-color:var(--primary)!important; }
.bg-secondary{ background-color:var(--secondary)!important; }
.bg-success{ background-color:var(--success)!important; }
.bg-danger{ background-color: var(--danger)!important; }
.bg-warning{ background-color:var(--warning)!important; }
.bg-info{ background-color: var(--info)!important; }
.bg-light{ background-color: var(--light)!important; }
.bg-dark{ background-color: var(--dark)!important; }
.bg-white{ background-color: #ffffff!important; }

.bg-light-secondary{background-color: #F1F1F1!important;}
.bg-light-white { background-color: #f7f7f7!important;  }

/* 外补丁 */
.m-0 { margin-left: 0;margin-right: 0;margin-top: 0;margin-bottom: 0;}
.m { margin-left: 5rpx;margin-right: 5rpx;margin-top: 5rpx;margin-bottom: 5rpx;}

.m-1 { margin-left: 10rpx;margin-right: 10rpx;margin-top: 10rpx;margin-bottom: 10rpx;}
.m-2 { margin-left: 20rpx;margin-right: 20rpx;margin-top: 20rpx;margin-bottom: 20rpx;}
.m-3 { margin-left: 30rpx;margin-right: 30rpx;margin-top: 30rpx;margin-bottom: 30rpx;}
.m-4 { margin-left: 40rpx;margin-right: 40rpx;margin-top: 40rpx;margin-bottom: 40rpx;}
.m-5 { margin-left: 50rpx;margin-right: 50rpx;margin-top: 50rpx;margin-bottom: 50rpx;}

.mx-0 { margin-left: 0;margin-right: 0;}
.mx { margin-left: 5rpx;margin-right: 5rpx;}
.mx-1 { margin-left: 10rpx;margin-right: 10rpx;}
.mx-2 { margin-left: 20rpx;margin-right: 20rpx;}
.mx-3 { margin-left: 30rpx;margin-right: 30rpx;}
.mx-4 { margin-left: 40rpx;margin-right: 40rpx;}
.mx-5 { margin-left: 50rpx;margin-right: 50rpx;}

.my-0 { margin-top: 0!important;margin-bottom: 0!important;}
.my { margin-top: 5rpx;margin-bottom: 5rpx;}
.my-1 { margin-top: 10rpx;margin-bottom: 10rpx;}
.my-2 { margin-top: 20rpx;margin-bottom: 20rpx;}
.my-3 { margin-top: 30rpx;margin-bottom: 30rpx;}
.my-4 { margin-top: 40rpx;margin-bottom: 40rpx;}
.my-5 { margin-top: 50rpx;margin-bottom: 50rpx;}

.mt-0 { margin-top: 0;}
.mt { margin-top: 5rpx;}
.mt-auto { margin-top: auto;}
.mt-1 { margin-top: 10rpx;}
.mt-2 { margin-top: 20rpx;}
.mt-3 { margin-top: 30rpx;}
.mt-4 { margin-top: 40rpx;}
.mt-5 { margin-top: 50rpx;}

.mb-0 { margin-bottom: 0;}
.mb { margin-bottom: 5rpx;}
.mb-auto { margin-bottom: auto;}
.mb-1 { margin-bottom: 10rpx;}
.mb-2 { margin-bottom: 20rpx;}
.mb-3 { margin-bottom: 30rpx;}
.mb-4 { margin-bottom: 40rpx;}
.mb-5 { margin-bottom: 50rpx;}

.ml-0 { margin-left: 0;}
.ml { margin-left: 5rpx;}
.ml-auto { margin-left: auto;}
.ml-1 { margin-left: 10rpx;}
.ml-2 { margin-left: 20rpx;}
.ml-3 { margin-left: 30rpx;}
.ml-4 { margin-left: 40rpx;}
.ml-5 { margin-left: 50rpx;}

.mr-0 { margin-right: 0;}
.mr { margin-right: 5rpx;}
.mr-1 { margin-right: 10rpx;}
.mr-2 { margin-right: 20rpx;}
.mr-3 { margin-right: 30rpx;}
.mr-4 { margin-right: 40rpx;}
.mr-5 { margin-right: 50rpx;}

/* 内补丁 */
.p-0 {padding-left: 0;padding-right: 0;padding-top: 0;padding-bottom: 0;}
.p {padding-left: 5rpx;padding-right: 5rpx;padding-top: 5rpx;padding-bottom:5rpx;}
.p-1 {padding-left: 10rpx;padding-right: 10rpx;padding-top: 10rpx;padding-bottom: 10rpx;}
.p-2 {padding-left: 20rpx;padding-right: 20rpx;padding-top: 20rpx;padding-bottom: 20rpx;}
.p-3 {padding-left: 30rpx;padding-right: 30rpx;padding-top: 30rpx;padding-bottom: 30rpx;}
.p-4 {padding-left: 40rpx;padding-right: 40rpx;padding-top: 40rpx;padding-bottom: 40rpx;}
.p-5 {padding-left: 50rpx;padding-right: 50rpx;padding-top: 50rpx;padding-bottom: 50rpx;}

.px-0 { padding-left: 0;padding-right: 0;}
.px { padding-left: 5rpx;padding-right: 5rpx;}
.px-1 { padding-left: 10rpx;padding-right: 10rpx;}
.px-1-5 { padding-left: 15rpx;padding-right: 15rpx;}

.px-2 { padding-left: 20rpx;padding-right: 20rpx;}
.px-3 { padding-left: 30rpx;padding-right: 30rpx;}
.px-4 { padding-left: 40rpx;padding-right: 40rpx;}
.px-5 { padding-left: 50rpx;padding-right: 50rpx;}

.py-0 { padding-top: 0;padding-bottom: 0;}
.py { padding-top: 5rpx;padding-bottom: 5rpx;}
.py-1 { padding-top: 10rpx;padding-bottom: 10rpx;}
.py-2 { padding-top: 20rpx;padding-bottom: 20rpx;}
.py-3 { padding-top: 30rpx;padding-bottom: 30rpx;}
.py-4 { padding-top: 40rpx;padding-bottom: 40rpx;}
.py-5 { padding-top: 50rpx;padding-bottom: 50rpx;}

.pt-0 { padding-top: 0;}
.pt { padding-top: 5rpx;}
.pt-1 { padding-top: 10rpx;}
.pt-2 { padding-top: 20rpx;}
.pt-3 { padding-top: 30rpx;}
.pt-4 { padding-top: 40rpx;}
.pt-5 { padding-top: 50rpx;}

.pb-0 { padding-bottom: 0;}
.pb { padding-bottom: 5rpx;}
.pb-1 { padding-bottom: 10rpx;}
.pb-2 { padding-bottom: 20rpx;}
.pb-3 { padding-bottom: 30rpx;}
.pb-4 { padding-bottom: 40rpx;}
.pb-5 { padding-bottom: 50rpx;}

.pl-0 { padding-left: 0;}
.pl { padding-left: 5rpx;}
.pl-1 { padding-left: 10rpx;}
.pl-2 { padding-left: 20rpx;}
.pl-3 { padding-left: 30rpx;}
.pl-4 { padding-left: 40rpx;}
.pl-5 { padding-left: 50rpx;}

.pr-0 { padding-right: 0;}
.pr { padding-right: 5rpx;}
.pr-1 { padding-right: 10rpx;}
.pr-2 { padding-right: 20rpx;}
.pr-3 { padding-right: 30rpx;}
.pr-4 { padding-right: 40rpx;}
.pr-5 { padding-right: 50rpx;}

/* box */

/* #ifndef APP-PLUS-NVUE */
.border-box{ box-sizing: border-box; }
/* #endif */

/* overflow */
.overflow-hidden { overflow: hidden; }

/* #ifndef APP-PLUS-NVUE */
.overflow-line-1 { display: -webkit-box;overflow: hidden;text-overflow: ellipsis; -webkit-line-clamp:1;-webkit-box-orient: vertical;}
.overflow-line-2 { display: -webkit-box;overflow: hidden;text-overflow: ellipsis; -webkit-line-clamp:2;-webkit-box-orient: vertical;}
.overflow-line-3 { display: -webkit-box;overflow: hidden;text-overflow: ellipsis; -webkit-line-clamp:3;-webkit-box-orient: vertical;}
/* #endif */

/* #ifndef APP-PLUS-NVUE */
.overflow-scroll-y { overflow-y: scroll; }
.overflow-scroll-x { overflow-x: scroll; }
/* #endif */

/* float */

/* #ifndef APP-PLUS-NVUE */
.fl { float: left; }
.fr { float: right; }
/* #endif */

/* float */
/* opaticy */
.op-1  {opacity: 1;}
.op-05 { opacity: .5; }

/* font */
.font-medium {
		font-family: PingFangSC, PingFangSC-Medium;
		font-weight: 500;
	}
.text-del{ text-decoration:line-through }
.richImg {
	width:100%!important;
	height: auto!important;
}
.common-tuigai {
    width: 80px;
    height: 28px;
    background: #ffffff;
    border-radius: 8px;
    text-align: center;
    line-height: 56rpx;
    font-family: PingFangSC, PingFangSC-Regular;
    color: #ff9c4f;
    margin: 30rpx;
}


/* 规范 */

/* 页面左右标准间距 */
.page-space {padding-left: 24rpx;padding-right: 24rpx;}
/* 大板块外间距 */
.box-space-top { margin-top: 32rpx;}
.box-space-bottom { margin-bottom: 32rpx;}
.box-space-y { margin-top: 32rpx;margin-bottom: 32rpx;}
/* 列表之间的间距 */
.list-space-top { margin-top: 24rpx;}
.list-space-bottom { margin-bottom:24rpx; }
.list-space-y { margin-top: 24rpx;margin-bottom: 24rpx; }
.price-color { color: #ff4848; }
.dot {width: 12rpx;height: 12rpx;background: #ff7a1c;border-radius: 50%;}
/* 规范 end */

.form-item {
	display: flex;
	flex-direction: column;
	margin: 20rpx 0;
}
.form-label {
	font-size: 30rpx;
	font-weight: 600;
}
.form-input {
	display: flex;
	align-items: center;
	font-size: 24rpx;
}
.form-input input {
	width: 100%;
	padding: 10rpx;
}
.form-input textarea {
	min-height: 60rpx;
	width: 100%;
	padding: 10rpx;
	border: 1px solid #eee;
}
.form-tag{
	padding: 10rpx 20rpx;
	color: #666;
	background-color:#EDEDED;
	margin-right: 20rpx;
}
.form-tag.active {
	color: #fff;
	background-color: $theme_color
}
.richImg {
	width:100%;height:100%;margin: 0 auto;margin-right:40px
}

</style>
